<extend name="../Public/base" />
<block name="title">文档报表</block>
<block name="body">
    <div class="mt-20">
        <div class="col-xs-12 col-sm-12" id="main" style="height:400px;">
        </div>
    </div>
</block>
<block name="js">
<script type="text/javascript" src="__PUBLIC_LIB__/echarts/echarts.min.js?v=3.3.2"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        color: ['#3398DB'],
        title: {
            text: '30天文档上传数量报表'
        },
        tooltip: {},
        legend: {
            data:['文档数']
        },
        xAxis: {
            data: [
            <php>
              foreach($list as $date=>$count) {
                echo '"'.$date.'",';
              }
             </php>
            ]
        },
        yAxis: {
            min: 0,
            max: 50,
            minInterval: 10
            //scale: true
        },
        series: [{
            name: '文档数',
            type: 'bar',
            label: {
                normal: {
                    show: true,
                    position: 'top'
                }
            },
            data: [
                <php>
                foreach($list as $date=>$count) {
                    echo '"'.$count.'",';
                }
                </php>
            ]
        }]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</block>